package com.udata.client.service.impl;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.udata.client.service.UserService;
import com.udata.server.dao.UserDao;
import com.udata.shared.exception.OperationException;
import com.udata.shared.model.UserB;

@SuppressWarnings("serial")
public class UserServiceImpl extends RemoteServiceServlet implements
		UserService {

	@Override
	public UserB saveUser(UserB user) {
		try {
			return UserDao.getinstance().saveUser(user);
		} catch (OperationException e) {
			return null;
		}
	}

	@Override
	public UserB login(String id, String password) {
		try {
			return UserDao.getinstance().login(id, password);
		} catch (OperationException e) {
			return null;

		}

	}

	@Override
	public UserB getUser(String id) throws OperationException {
	
			return UserDao.getinstance().getUser(id);
	
	}

	@Override
	public UserB registerUser(UserB userB) throws OperationException {
		return UserDao.getinstance().registerUser(userB);
	}

}
